<div class="bg-light lter b-b wrapper-md">
    <h1 class="m-n font-thin h3">
        <span class="font-bold" translate="aside.nav.query.serviceSearch">Service Reqests</span>
    </h1>
</div>
<div ng-class="isSmart?'':'wrapper-md'" class="remove-wrapper" ng-controller="ServReqController" ng-init="init()">
    <div class="panel panel-default">
        <div class="col-xs-12 wrapper-sm">
            <div class="input-group">
                <input type="text"
                       placeholder="{{ (selectLang == 'English') ? 'enter keywords' : '\u8bf7\u8f93\u5165\u5173\u952e\u5b57' }}"
                       class="form-control" ng-model="page.like" autocomplete="off">
                <span class="input-group-btn">
					<button class="btn btn-success font-bold" type="button" translate="business.navtitle.search_patient"
                            ng-click="init()"></button></span>
            </div>
        </div>
        <table class="table table-striped b-t b-light">
            <thead>
            <tr class="panel-heading">
                <th translate="business.servreq.id"></th>
                <th ng-if="!isSmart" translate="common.updated"></th>
                <th translate="common.name"></th>
                <th ng-if="!isSmart" translate="user.gender"></th>
                <th translate="business.servreq.serviceType"></th>
                <th ng-if="!isSmart" translate="business.servreq.status"></th>
                <th><span class="font-bold" translate="common.operate">Operate</span></th>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat="model in servReqs">
                <td>S-{{ model.servReq_Id }}</td>
                <td ng-if="!isSmart">{{ moment(model.updated).format("YYYY-MM-DD") }}</td>
                <td>{{ model._patCase._patient._user.realName }}</td>
                <td ng-if="!isSmart">
                    <span ng-show="model._patCase._patient._user.gender != null"
                          translate="{{ 'user.gender.' + model._patCase._patient._user.gender  }}"></span>
                </td>
                <td>
                    <span translate="{{'servicetype.servicetype_' + model._servType.service_Id }}"></span>
                </td>
                <td ng-if="!isSmart">{{ (selectLang == "English") ? model._status.enName : model._status.cnName }}</td>
                <td>
                    <div>
                        <button type="button"
                                ng-click="open({ templateUrl: 'openServReq.html'}, {{ model }});"
                                class="btn btn-sm btn-info font-bold"
                                title="{{ 'common.details' | translate }}"
                                translate="common.details">
                        </button>
                    </div>
                </td>
            </tr>
            </tbody>
        </table>
        <footer class="panel-footer">
            <div class="row">
                <div class="col-sm-4 text-left">
                    <small class="text-muted inline m-t-sm m-b-sm"><span translate="common.showing"></span>
                        {{page.totalItems==0?0:(page.currentPage-1)*page.itemsPerPage+1}}
                        - {{(page.currentPage-1)*page.itemsPerPage+page.currentItems}}
                        <span translate="common.of"></span> {{page.totalItems}} <span translate="common.items"></span>
                    </small>
                </div>
                <div class="col-sm-8 text-right text-center-xs">
                    <pagination ng-model="page.currentPage" ng-change="pageChanged()"
                                total-items="page.totalItems" items-per-page="page.itemsPerPage"
                                max-size="page.maxSize" class="pagination-sm m-t-none m-b"
                                boundary-links="true" rotate="false" previous-text="&lsaquo;"
                                next-text="&rsaquo;" first-text="&laquo;" last-text="&raquo;"></pagination>
                </div>
            </div>
        </footer>
    </div>
    <script type="text/ng-template" id="openServReq.html">
        <div ng-include="'views/work/basic_servreq_flow.html?tmp=2'"></div>
    </script>
</div>
